﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ShootSearch.Runner.Controls;

namespace ShootSearch.Runner
{
    public partial class FormMain : Form
    {
        FormMainControl control = null;

        public FormMain()
        {
            InitializeComponent();
            control = new FormMainControl(this);
        }

        private void FormMain_Load(object sender, EventArgs e)
        {
            listViewTasks.Items.Clear();
            control.LoadTasks();

        }

        private void tsButtonNewTask_Click(object sender, EventArgs e)
        {
            control.NewTask();
        }

        private void tsButtonRun_Click(object sender, EventArgs e)
        {
            control.TaskRun();
        }

        private void tsButtonStop_Click(object sender, EventArgs e)
        {
            control.TaskStop();
        }

        private void listViewTasks_Click(object sender, EventArgs e)
        {
            if (listViewTasks.TileSize.Height > 0)
                listViewTasks.TileSize = new Size(listViewTasks.Width - 15,
                            listViewTasks.TileSize.Height);
            control.ItemActivate();
        }




    }
}
